package teamGiga.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import teamGiga.bean.TheaterRoomBean;
import teamGiga.dao.MovieDao;
import action.servlet.ActionForWard;

public class TrsdAction extends Action{
	private String path;
	private boolean redirect;
	
	public TrsdAction() {
		super();
	}

	public TrsdAction(String path, boolean redirect) {
		super();
		this.path = path;
		this.redirect = redirect;
	}

	@Override
	public ActionForWard execute(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub
		int trnum=Integer.parseInt(request.getParameter("trnum"));
		String capacity=request.getParameter("capacity");
		int mno=0;
		String showing="x";
		int tno=Integer.parseInt(request.getParameter("tno"));
		TheaterRoomBean trbean=new TheaterRoomBean(trnum,capacity,tno);
		try {
			MovieDao.settr(trbean);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return new ActionForWard(path, redirect);
	}
	
	
}
